import * as echarts from 'echarts'
export default function Drow(){
  //获取Dom节点
  let chartDom = this.$refs.Dom;
  //初始化echarts实例
  let myChart = this.$echarts.init(chartDom);
  //绘制图标
  let option;
  option = {
    backgroundColor: '#C2E7B0',
    tooltip: {
      trigger: 'axis',
      axisPointer: {
        type: 'shadow',
        label: {
          show: true,
          backgroundColor: '#333'
        }
      }
    },
    dataset: [{
        dimensions: ['Hour', 'humidity'],
        source: this.data
      }],
    legend: {
      data: ['line', 'bar'],
      textStyle: {
        color: '#00aaff'
      }
    },
    xAxis: {
       type: "category",
      axisLabel: {
        formatter: '{value} :00 ',
      },
      axisLine: {
        lineStyle: {
          color: '#0077AA'
        }
      }
    },
    yAxis: {
      splitLine: {
        show: false
      },
      axisLabel: {
        formatter: '{value} % ',
      },
      axisLine: {
        lineStyle: {
          color: '#0077AA'
        }
      }
    },
    series: [{
      name: 'line',
      type: 'line',
      // smooth: true,
      showAllSymbol: true,
      symbol: 'emptyCircle',
      symbolSize: 15,
    }, {
      name: 'bar',
      type: 'bar',
      barWidth: 10,
      itemStyle: {
        normal: {
          barBorderRadius: 5,
          color: new echarts.graphic.LinearGradient(
            0, 0, 0, 1,
            [{
                offset: 0,
                color: '#14c8d4'
              },
              {
                offset: 1,
                color: '#43eec6'
              }
            ]
          )
        }
      },
    }]
  };
    option && myChart.setOption(option);
}
